home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 13023 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.0 KB

  1. Path: elroy.jpl.nasa.gov!decwrl!purdue!yuma!steffend
  2. From: steffend@lamar.colostate.edu (Dave Steffen)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: scientific c++ standard template library (vector & matrx)
  5. Date: 23 Mar 1996 00:51:19 GMT
  6. Organization: Colorado State University, Fort Collins, CO  80523
  7. Message-ID: <4ivhu7$1ncg@yuma.ACNS.ColoState.EDU>
  8. References: <4isep1$agc@newshost.lanl.gov>
  9. NNTP-Posting-Host: glitch.physics.colostate.edu
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Liang Lu (llu) wrote:
  13.  
  14. > I am looking for a scientific c++ standard template library (vector
  15. > & matrx) including vector and matrix operations such as addition,
  16. > subtruction, multiplication and etc. Please send me an email if you
  17. > have information.
  18. > - 
  19. > Best Regards,
  20.  
  21. > Liang
  22.  
  23.     I'd steer you in several possible directions... all at the
  24. same time. ;-)
  25.  
  26. A) First off, the STL has some kind of vector classes, I believe; I
  27. don't know beans about the STL but it might be worth a look.
  28.  
  29. B) Barton and Nackman have an excellent book out called... damn, can't
  30. get the name right now. Really good book, they do quite a bit with
  31. vector and matrix classes, I think they're wrapping Fortran LAPACK
  32. routines. One potential problem: they make EXTENSIVE use of exceptions
  33. and templates, so your compiler may very well give you the finger if
  34. it's not up to snuff (I use g++ 2.7.0, great compiler but very likely
  35. would barf on their code - that's a guess.)
  36.  
  37. C) LAPACK++ has been around for a while, I don't know what state it's
  38. in right now. A while back I was looking what you're after, but
  39. decided against LAPACK++ for three reasons:
  40.  
  41.     a) I didn't like using () for matrix and vector indices. My
  42. code was (at the time) going to be using old-fashioned "C" arrays too,
  43. and I didn't want to have to keep track of what needed [] and what
  44. needed () to access an element.
  45.  
  46.     b) At the time LAPACK++ didn't implement the routines for
  47. Hermitian matrices (or complex matrices at all) as far as I could
  48. tell. As that was the only kind of matrix I was using (quantum
  49. mechanics and all that) LAPACK++ wouldn't have helped me anyway.
  50.  
  51.     c) I couldn't get it to compile! ;-) YMMV.
  52.  
  53.     ... so I ended up doing it myself. At this point I've got
  54. templated vectors, matrices, and 3rd-rank tensors. They use the
  55. occasional LAPACK call for multiplication and the like, and they're
  56. pretty fast; the profiler tells me my code is spending >70% of its
  57. time actually _in_ the LAPACK routines. I only needed five or six
  58. LAPACK routines so the thing didn't take that much work to get
  59. running.
  60.  
  61.     Anyway, hope that helps.
  62.  
  63.                                  /\
  64.                                  \/
  65.  
  66. Dave Steffen                      No, his mind is not for rent
  67. Dept. of Physics                  To any God or Government
  68. Colorado State University         Always hopeful, yet discontent
  69. steffend@lamar.colostate edu      He knows changes aren't permanent-
  70.                       But change is...
  71. "Speak softly...                    
  72. ... and carry a black belt!"              -Neal Peart / RUSH
  73. -----------------------------------------------------------------------
  74.  
  75.  
  76.  
  77.